<!-- 用户列表 -->
<template>
	<section>
		<!--工具条-->
		<el-col :span="24" class="toolbar">
			<el-form :inline="true" :model="filters">
				<el-form-item>
					<el-input v-model="filters.name" placeholder="请输入用户对应的查询条件">
						<el-select v-model="select" slot="prepend" placeholder="请选择" @change="changePriceValue" style="width: 120px;">
						  <el-option label="用户ID" value="1"></el-option>
						  <el-option label="PID" value="2"></el-option>
						  <el-option label="邀请码" value="3"></el-option>
						  <el-option label="手机号" value="4"></el-option>
						  <el-option label="上级邀请" value="5"></el-option>
						  <el-option label="星级查询" value="6"></el-option>
						  <el-option label="达人级别" value="7"></el-option>
						</el-select>
					</el-input>
				</el-form-item>
				<el-form-item>
					<el-button type="primary" v-on:click="getUsers">查询</el-button>
				</el-form-item>
				<el-form-item>
					<el-dropdown size="small" placement="bottom" trigger="click" @command="batchOperate" style="margin-left: 10px;">
					    <el-button type="success" class="search-btn">
							导出
							<i class="el-icon-arrow-down el-icon--right"></i>
					    </el-button>
					    <el-dropdown-menu slot="dropdown">
							<el-dropdown-item command="rece_excel" style='width: 100px;margin-bottom: 5px;text-align: center;'>
								<el-button type="primary" size="small" icon="el-icon-download">&nbsp;达&nbsp;人&nbsp;级&nbsp;别</el-button>
							</el-dropdown-item>
							<el-dropdown-item command="cus_excel">
								<el-button type="primary" size="small" icon="el-icon-download">自定义星级</el-button>
							</el-dropdown-item>
					    </el-dropdown-menu>
					</el-dropdown>
				</el-form-item>
			</el-form>
		</el-col>

		<!--列表-->
		<el-table :data="UserList" highlight-current-row v-loading="loading" border :cell-style="cellStyle" :header-cell-style="rowClass" style="width: 100%;">
			<el-table-column prop="id" align="center" label="ID" width="100">
			</el-table-column>
			<el-table-column prop="name" align="center" label="昵称" width="130">
				<template slot-scope="scope">
					<el-popover trigger="hover" placement="top">
						<img :src="scope.row.wallet" alt="" width="100%">
						<div slot="reference" class="name-wrapper">
							<el-tag size="medium">{{ scope.row.name}}</el-tag>
						</div>
					</el-popover>
				</template>
			</el-table-column>
			<el-table-column prop="phone" align="center" label="手机号" width="120"></el-table-column>
			<el-table-column prop="is_real" align="center" label="是否实名" width="120" :formatter="formatReal"></el-table-column>
			<el-table-column prop="openId" align="center" label="微信绑定" width="300" >
				<template slot-scope="scope">
					<p v-if="scope.row.openId != ''">{{scope.row.openId}}</p>
					<p v-else>未绑定微信</p>
				</template>
			</el-table-column>
			<el-table-column prop="no" align="center" label="邀请码" width="120"></el-table-column>
			<el-table-column prop="dirctNum" align="center" label="直推人数" width="120"></el-table-column>
			<el-table-column prop="level" align="center" label="等级" width="120"></el-table-column>
			<el-table-column prop="starLevel" align="center" label="星级" width="120"></el-table-column>
			<el-table-column prop="shaddockNum" align="center" label="柚子数" width="120"></el-table-column>
			<el-table-column prop="coins" align="center" label="柚子币" width="120"></el-table-column>
			<el-table-column label="管理" align="center" width="260">
				<template slot-scope="scope">
					<el-button size="small" type="primary" @click="handleMent(scope.$index, scope.row)" icon="el-icon-user-solid">账号管理</el-button>
					<el-button size="small" type="primary" @click="handleTeam(scope.$index, scope.row)" icon="el-icon-view">团队资产</el-button>
				</template>
			</el-table-column>
			<el-table-column label="操作" align="center" width="240">
				<template slot-scope="scope">
					<el-button size="small" type="primary" @click="handleDetail(scope.$index, scope.row)" icon="el-icon-view">详情</el-button>
					<el-dropdown size="small" placement="bottom" trigger="click" style="margin-left: 10px;">
						<el-button type="success" class="search-btn" size="small">
						  操作
						 <i class="el-icon-arrow-down el-icon--right"></i>
						</el-button>
					   <el-dropdown-menu slot="dropdown">
							<el-dropdown-item command="batch_remarks" style='width: 100px;margin-bottom: 5px;' >
								<el-button v-if="scope.row.is_real == '0'" type="warning" size="small" @click="handlereal(scope.$index, scope.row)" icon="el-icon-edit" style='width: 100px;'>实名</el-button>
								<el-button v-else-if="scope.row.is_real == '1'" type="info" size="small" icon="el-icon-star-off" style='width: 100px;'>已实名</el-button>
							</el-dropdown-item>
							<el-dropdown-item command="export_excel" style='width: 100px;margin-bottom: 5px;'>
								<el-button v-if="scope.row.isBlock == '0'" type="danger" size="small" @click="handleblock(scope.$index, scope.row)" icon="el-icon-edit" style='width: 100px;'>拉黑</el-button>
								<el-button v-else-if="scope.row.isBlock == '1'" type="warning" size="small" @click="handleblock(scope.$index, scope.row)" icon="el-icon-view" style='width: 100px;'>取消拉黑</el-button>
							</el-dropdown-item>
							<el-dropdown-item command="export_forbid" style='width: 100px;margin-bottom: 5px;'>
								<el-button v-if="scope.row.forbid == '0'" type="danger" size="small" @click="handlforbid(scope.$index, scope.row)" icon="el-icon-edit" style='width: 100px;'>封停</el-button>
								<el-button v-else-if="scope.row.forbid == '1'" type="warning" size="small" @click="handlforbid(scope.$index, scope.row)" icon="el-icon-view" style='width: 100px;'>取消封停</el-button>
							</el-dropdown-item>
							<el-dropdown-item command="export_excel" style='width: 100px;margin-bottom: 5px;'>
								<el-button type="danger" size="small" @click="handleblack(scope.$index, scope.row,1)" icon="el-icon-edit" style='width: 100px;'>拉黑团队</el-button>
							</el-dropdown-item>
							<el-dropdown-item command="export_excel" style='width: 100px;margin-bottom: 5px;'>
								<el-button type="success" size="small" @click="handleblack(scope.$index, scope.row,2)" icon="el-icon-edit" style='width: 100px;'>解封团队</el-button>
							</el-dropdown-item>
							<el-dropdown-item command="export_openid" style='width: 100px;margin-bottom: 5px;'>
								<el-button v-if="scope.row.openId != ''" type="danger" size="small" @click="handlopenid(scope.$index, scope.row)" icon="el-icon-edit" style='width: 100px;'>解绑微信</el-button>
							</el-dropdown-item>
					  </el-dropdown-menu>
					</el-dropdown>
				</template>
			</el-table-column>
		</el-table>
		<!--批量删除-->
		<el-col :span="24" class="toolbar">
			<el-pagination background layout="total,sizes,prev, pager, next,jumper" @size-change="handleSizeChange" @current-change="handleCurrentChange" :page-size="10" :total="total" style="float:right;">
			</el-pagination>
		</el-col>
		
		<!-- 查看详情 -->
		<el-dialog title="用户详情" :visible.sync="FormVisible" width="60%" :before-close="handleClose" style="margin-top: -10vh !important;">
			<div style="text-align: right;">
				<el-button size="small" type="primary" @click="Refresh(UserDetail.id)" >刷新星级和资产包</el-button>
			</div>
			<el-col :span="24" class="toolbar">
				<span>基本信息</span>
			</el-col>
			<el-form style="margin-top: 60px;">
				<el-form-item label="用户名" prop="name" style="float: left;width: 50%;margin-bottom:10px;display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">用&nbsp;户&nbsp;名：</label>
					<el-input v-model="UserDetail.name" auto-complete="off" style="width: 300px;color: #000 !important;" readonly></el-input>
				</el-form-item>
				<el-form-item label="手机号" prop="phone" style="display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">手&nbsp;&nbsp;机&nbsp;&nbsp;号：</label>
					<el-input v-model="UserDetail.phone" auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="性别" prop="pwd" style="float: left;width: 50%;margin-bottom:10px;display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：</label>
					<el-input v-if="UserDetail.sex == '0'" v-model="this.sex0" auto-complete="off" style="width: 300px;" readonly></el-input>
					<el-input v-else-if="UserDetail.sex == '1'" v-model="this.sex1" auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="是否实名" prop="isreal" style="display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">是否实名：</label>
					<el-input v-if="UserDetail.is_real == '0'" v-model="this.real0" auto-complete="off" style="width: 300px;" readonly></el-input>
					<el-input v-else-if="UserDetail.is_real == '1'" v-model="this.real1" auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="是否拉黑" prop="isBlock" style="float: left;width: 50%;display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">是否拉黑：</label>
					<el-input v-if="UserDetail.isBlock == '0'" v-model="this.Block0" auto-complete="off" style="width: 300px;" readonly></el-input>
					<el-input v-else-if="UserDetail.isBlock == '1'" v-model="this.Block1" auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="是否封停交易" prop="forbid" style="display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">是否封停交易：</label>
					<el-input v-if="UserDetail.forbid == '0'" v-model="this.Forbid0" auto-complete="off" style="width: 300px;" readonly></el-input>
					<el-input v-else-if="UserDetail.forbid == '1'" v-model="this.Forbid1" auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="是否绑定微信" prop="openId" style="width: 50%;display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">是否绑定微信：</label>
					<el-input v-if="UserDetail.openId != ''" v-model="UserDetail.openId" auto-complete="off" style="width: 300px;" readonly></el-input>
					<el-input v-else v-model="this.open" auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
			</el-form>
			<el-col :span="24" class="toolbar">
				<span>详细信息</span>
			</el-col>
			<el-form>
				<el-form-item label="用户ID" prop="id" style="float: left;width: 50%;display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">用&nbsp;户&nbsp;ID：</label>
					<el-input v-model="UserDetail.id" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="邀请码" prop="no" style="width: 50%; display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">邀&nbsp;请&nbsp;码：</label>
					<el-input v-model="UserDetail.no" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="活跃度" prop="activation" style="float: left;width: 50%;margin-bottom: 10px; display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">活&nbsp;跃&nbsp;度：</label>
					<el-input v-model="UserDetail.activation" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="贡献度" prop="level" style="display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">贡&nbsp;献&nbsp;度：</label>
					<el-input v-model="UserDetail.level" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="星级" prop="starLevel" style="float: left;width: 50%;display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">星&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;级：</label>
					<el-input v-model="UserDetail.starLevel" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="达人豆" prop="peas" style="display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">达&nbsp;人&nbsp;豆：</label>
					<el-input v-model="UserDetail.peas" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="经验值" prop="experience" style="float: left;width: 50%;display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">经&nbsp;验&nbsp;值：</label>
					<el-input v-model="UserDetail.experience" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="直推人数" prop="dirctNum" style="display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">直推人数：</label>
					<el-input v-model="UserDetail.dirctNum" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="柚子数" prop="shaddockNum" style="float: left;width: 50%;display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">柚&nbsp;子&nbsp;数：</label>
					<el-input v-model="UserDetail.shaddockNum" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="网红钻数" prop="reddiamond" style="display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">网红钻数：</label>
					<el-input v-model="UserDetail.Reddiamond" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="推荐人ID" prop="pid" style="float: left;width: 50%;display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">推荐人ID：</label>
					<el-input v-model="UserDetail.pid" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="喜欢数" prop="userPrefer" style="display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">喜&nbsp;欢&nbsp;数：</label>
					<el-input v-model="UserDetail.userPrefer" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="被关注数" prop="userByFollow" style="float: left;width: 50%;display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">被关注数：</label>
					<el-input v-model="UserDetail.userByFollow" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="注册时间" prop="registerTime" style="display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">注册时间：</label>
					<el-input v-model="UserDetail.registerTime" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="用户关注数" prop="userFollow" style="float: left;width: 50%;display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">用户关注数：</label>
					<el-input v-model="UserDetail.userFollow" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="邀请人Code" prop="invitationCode" style="display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">邀请人Code：</label>
					<el-input v-model="UserDetail.invitationCode" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="柚子币" prop="coins" style="display: flex;flex-direction: column;align-items: baseline;">
					<label slot="label">柚&nbsp;子&nbsp;币：</label>
					<el-input v-model="UserDetail.coins" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
			</el-form>
			<el-col :span="24" class="toolbar">
				<span>团队信息</span>
			</el-col>
			<el-form>
				<el-form-item label="团队活跃度" prop="realName" style="float: left;width: 50%;display: flex;flex-direction: column;align-items: baseline;">
					<el-input v-model="UserDetail.funsActivation" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="团队总人数" prop="realName" style="width: 50%; display: flex;flex-direction: column;align-items: baseline;">
					<el-input v-model="UserDetail.teamTotal" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="团队柚子数" prop="realName" style="float: left;width: 50%;display: flex;flex-direction: column;align-items: baseline;">
					<el-input v-model="UserDetail.teamShaddock" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
				<el-form-item label="团队实名数" prop="realName" style="display: flex;flex-direction: column;align-items: baseline;">
					<el-input v-model="UserDetail.teamNum" size='100'auto-complete="off" style="width: 300px;" readonly></el-input>
				</el-form-item>
			</el-form>
		</el-dialog>
		<!-- 自定义导出 -->
		<el-dialog title="自定义星级导出" :visible.sync="cusexcel" width="35%" :before-close="handleClose">
			<el-form :model="excelForm" label-width="105px" :rules="exceFormRules" ref="excelForm">
				<el-form-item label="用户星级" prop="starLevel">
					<el-input v-model="excelForm.starLevel" auto-complete="off" placeholder="请输入用户星级" style="width: 220px;"></el-input>
				</el-form-item>
			</el-form>
			<span slot="footer" class="dialog-footer">
				<el-button @click="cusexcel = false">取 消</el-button>
				<el-button type="primary"  @click.native="excelSubmit(1)" >提交</el-button>
			</span>
		</el-dialog>
		<el-dialog title="达人等级导出" :visible.sync="drexcel" width="35%" :before-close="handleClose">
			<el-form :model="excelForm" label-width="105px" :rules="exceFormRules" ref="excelForm">
				<el-form-item label="达人等级" prop="darenNum">
					<el-input v-model="excelForm.darenNum" auto-complete="off" placeholder="请输入达人等级" style="width: 220px;"></el-input>
				</el-form-item>
			</el-form>
			<span slot="footer" class="dialog-footer">
				<el-button @click="drexcel = false">取 消</el-button>
				<el-button type="primary"  @click.native="excelSubmit(2)" >提交</el-button>
			</span>
		</el-dialog>
		<!-- 账号管理 -->
		<el-dialog title="账号管理" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
			<el-table :data="MentList" highlight-current-row v-loading="loading" @selection-change="selsChange" border :cell-style="cellStyle" :header-cell-style="rowClass" style="width: 100%;">
				<el-table-column type="index" align="center" label="ID" width="80"></el-table-column>
				<el-table-column prop="accountName" align="center" label="账号姓名" width="100"></el-table-column>
				<el-table-column prop="accountNo" align="center" label="账号" width="260"></el-table-column>
				<el-table-column prop="accountType" align="center" label="账号类型">
					<template slot-scope="scope">
						<p v-if="scope.row.accountType == '0'">支付宝</p>
						<p v-else-if="scope.row.accountType == '1'">微信</p>
						<p v-else-if="scope.row.accountType == '2'">银行卡</p>
					</template>
				</el-table-column>
				<el-table-column label="操作" align="center" width="200">
					<template slot-scope="scope">
						<el-button size="small" type="primary" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
						<el-button size="small" type="danger" icon="el-icon-delete" @click="handleDel(scope.$index, scope.row)">删除</el-button>
					</template>
				</el-table-column>
			</el-table>
			<span slot="footer" class="dialog-footer">
				<el-button @click="dialogVisible = false">取 消</el-button>
			</span>
		</el-dialog>
		<el-dialog title="账号修改" :visible.sync="editFormVisible" width="40%" :before-close="handleClose" style="margin-top: -100px;">
			<el-form :model="editForm" label-width="105px" ref="editForm">
				<el-form-item label="账号id" prop="id" style="display: none;">
					<el-input v-model="editForm.id" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="账号姓名" prop="accountName">
					<el-input v-model="editForm.accountName" auto-complete="off" placeholder="商品名称"></el-input>
				</el-form-item>
				<el-form-item label="账号" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="editForm.accountNo" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="账号类型" prop="accountType" style="margin-top: 20px;">
					<el-radio-group v-model="editForm.accountType">
						<el-radio class="radio" :label="0">支付宝</el-radio>
						<el-radio class="radio" :label="1">微信</el-radio>
						<el-radio class="radio" :label="2">银行卡</el-radio>
					</el-radio-group>
				</el-form-item>
			</el-form>
			<span slot="footer" class="dialog-footer">
				<el-button @click="editFormVisible = false">取 消</el-button>
				<el-button type="primary"  @click.native="editSubmit"  :loading="loading">确定</el-button>
			</span>
		</el-dialog>
		<!-- 团队 -->
		<el-dialog title="团队资产" :visible.sync="ListForm" width="50%" :before-close="handleClose" style="margin-top: -100px;">
			<el-form label-width="105px" ref="editForm">
				<el-form-item label="大区活跃人数" prop="List" style="margin-top: 20px;">
					<el-input v-model="List.bigFunsActivation" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="大区人数" prop="accountName" style="margin-top: 20px;">
					<el-input v-model="List.bigTeamNum" auto-complete="off" placeholder="商品名称"></el-input>
				</el-form-item>
				<el-form-item label="资产包" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.capitalPackage" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="达人级别" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.darenNum" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="锁定资产包" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.lockCapitalPackage" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="团队锁定资产包" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.lockTeamCapitalPackage" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="其它区活跃人数" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.otherFunsActivation" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="其它区人数" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.otherTeamNum" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="团队资产包" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.teamCapitalPackage" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="初级达人数" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.teamDarenNum1" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="中级达人数" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.teamDarenNum2" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="高级达人数" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.teamDarenNum3" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="特级达人数" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.teamDarenNum4" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="超级达人数" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.teamDarenNum5" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
				<el-form-item label="团队合格金主数" prop="accountNo" style="margin-top: 20px;">
					<el-input v-model="List.teamLevelNum" auto-complete="off" placeholder="价格保留2位小数"></el-input>
				</el-form-item>
			</el-form>
			<span slot="footer" class="dialog-footer">
				<el-button @click="ListForm = false">取 消</el-button>
				<el-button type="primary"  @click.native="editSubmit"  :loading="loading">确定</el-button>
			</span>
		</el-dialog>
	</section>
</template>
<script>
	import util from '../../../common/js/util'
	import {
		getUserList,
		getUserDetail,
		editUser,
		getUpload,
		getAccountInfo,
		editAccountInfo,
		delAccountInfo,
		getTeamInfo,
		ReTeamInfo,
		clearUserWx,
		editpullBlackTeam,
		Refreshtoken
	} from '../../../api/api';
	export default {
		data() {
			return {
				loading: false,
				filters: {
					name:'',
					id:''
				},
				select: '',
				vid:'',
				UserList: [],
				UserDetail:{},
				sels: [],//列表选中列81560
				total: 0,
				page: 1,
				size:10,
				timer: null,
				FormVisible:false,//弹出层
				sex0: '女',
				sex1: '男',
				real0:'未实名',
				real1:'已实名',
				Block0:'用户正常',
				Block1:'用户停用',
				Forbid0:'否',
				Forbid1:'是',
				open:'未绑定微信',
				// 自定义星级
				cusexcel:false,
				drexcel:false,
				excelForm:{
					starLevel:'',//星级
					darenNum:''
				},
				exceFormRules:{
					starLevel: [{
						required: true,
						message: '请输入星级',
						trigger: 'blur'
					}],
					darenNum:[{
						required: true,
						message: '请输入达人等级',
						trigger: 'blur'
					}],
				},
				MentList:[],
				dialogVisible:false,
				editFormVisible:false,
				editForm:{
					id:'',
					accountName:'',
					accountNo: '',
					accountType: 0,
				},
				ListForm:false,
				List:{}
			}
		},
		mounted() {
			var Token = sessionStorage.getItem('Token');
			var timestamp=new Date().getTime();
			let para = {
				token: Token,
				curpage:this.page,
				pagesize:this.size,
				timestamp: timestamp
			};
			this.loading = true;
			getUserList(para).then((res) => {
				var res = res.data;
				if (res.code != 0) {
					this.$message({
						message: res.message,
						type: 'error'
					});
				} else {
					this.total = res.data.total;
					this.UserList = res.data.list;
					this.loading = false;
				}
			});
			
			this.queryInfo();
			this.timer = setInterval(() => {
			   setTimeout(this.queryInfo, 0)
		    }, 600000)
		},
		methods: {
			// 设置定时器
			queryInfo() {
				var Token = sessionStorage.getItem('Token');
				var timestamp=new Date().getTime();
				let para = {token: Token,timestamp: timestamp};
				Refreshtoken(para).then((res) => {
					var res = res.data;
					if (res.code != 0) {
						this.$message({
							message: res.message,
							type: 'error'
						});
					} else {
						this.loading = false;
					}
				});
			},
			// 修改用户信息（实名，拉黑和修改密码）
			handlereal(index,row){
				var Token = sessionStorage.getItem('Token');
				var timestamp=new Date().getTime();
				if (row.is_real == 0) {
					// 未认证，传值1为认证
					var real = 1
				} else{
					var real = 0
				}
				
				let para = {
					token: Token,
					id:row.id,
					isReal:real,//是否认证
					timestamp: timestamp
				};
				this.loading = true;
				editUser(para).then((res) => {
					var res = res.data;
					if (res.code != 0) {
						this.loading = false;
						this.$message({
							message: res.message,
							type: 'error'
						});
					} else {
						this.loading = false;
						this.getUsersList();
					}
				});
			},
			handleblock(index,row){
				var Token = sessionStorage.getItem('Token');
				var timestamp=new Date().getTime();
				if (row.isBlock == 0) {
					var Block = 1
				} else{
					var Block = 0
				}
				let para = {
					token: Token,
					id:row.id,
					isBlack:Block,//是否拉黑
					timestamp: timestamp
				};
				this.loading = true;
				editUser(para).then((res) => {
					var res = res.data;
					if (res.code != 0) {
						this.$message({
							message: res.message,
							type: 'error'
						});
					} else {
						this.loading = false;
						this.getUsersList();
					}
				});
			},
			//是否封停团队
			handleblack(index,row,type){
				var Token = sessionStorage.getItem('Token');
				var timestamp=new Date().getTime();
				if (type == 1) {
					this.$confirm('封停团队请谨慎操作', '提示', {}).then(() => {
						let para = {token: Token,userId:row.id,isBlock:1,timestamp: timestamp};
						this.loading = true;
						editpullBlackTeam(para).then((res) => {
							var res = res.data;
							if (res.code != 0) {
								this.$message({
									message: res.message,
									type: 'error'
								});
							} else {
								this.loading = false;
								this.getUsersList();
							}
						});
					});
				} else if(type == 2){
					let para = {token: Token,userId:row.id,isBlock:0,timestamp: timestamp};
					this.loading = true;
					editpullBlackTeam(para).then((res) => {
						var res = res.data;
						if (res.code != 0) {
							this.$message({
								message: res.message,
								type: 'error'
							});
						} else {
							this.loading = false;
							this.getUsersList();
						}
					});
				}
			},
			// 是否封停
			handlforbid(index,row){
				var Token = sessionStorage.getItem('Token');
				var timestamp=new Date().getTime();
				if (row.forbid == 0) {
					var Block = 1
				} else{
					var Block = 0
				}
				let para = {token: Token,id:row.id,forbid:Block,timestamp: timestamp};
				this.loading = true;
				editUser(para).then((res) => {
					var res = res.data;
					if (res.code != 0) {
						this.$message({
							message: res.message,
							type: 'error'
						});
					} else {
						this.loading = false;
						this.getUsersList();
					}
				});
			},
			//解绑微信
			handlopenid(index,row){
				this.$confirm('确认解绑微信吗？', '提示', {}).then(() => {
					var Token = sessionStorage.getItem('Token');
					var timestamp=new Date().getTime();
					let para = {token: Token,id:row.id,timestamp: timestamp};
					this.loading = true;
					clearUserWx(para).then((res) => {
						var res = res.data;
						if (res.code != 0) {
							this.$message({
								message: res.message,
								type: 'error'
							});
						} else {
							this.loading = false;
							this.$notify({ title: '成功', message: '解绑微信成功', type: 'success' });
							this.getUsersList();
						}
					});
				});
			},
			// 转换性别状态
			formatSex: function (row, column) {
				return row.sex == 1 ? '男' : row.sex == 0 ? '女' : '未知';
			},
			// 转换实名状态
			formatReal:function (row, column) {
				return row.is_real == 1 ? '是' : row.is_real == 0 ? '否' : '未知';
			},
			// 转换拉黑状态
			formatBlock:function (row, column) {
				return row.isBlock == 1 ? '是' : row.isBlock == 0 ? '否' : '未知';
			},
			// 是否封停
			formatforbid:function(row,column){
				return row.forbid == 1 ? '是' : row.forbid == 0 ? '否' : '未知';
			},
			selsChange: function (sels) {
				this.sels = sels;
			},
			cellStyle({row, column}){
				return 'text-align:center;padding:6px;';
			},
			rowClass({row, column}){
				return 'text-align:center';
			},
			changePriceValue(val){
			 this.vid = val;
			},
			handleSizeChange(val) {
				this.size = val;
				this.getUsersList();
			},
			handleCurrentChange(currentPage) {
				this.page = currentPage;
				this.getUsersList();
			},
			//获取用户列表
			getUsers: function() {
				var Token = sessionStorage.getItem('Token');
				var timestamp=new Date().getTime();
				if(this.vid == ''){
					this.$notify({ title: '警告', message: '请输入查询的条件', type: 'warning' });
				}else{
					if(this.vid == 1){
						var para = {token: Token, curpage:this.page, pagesize:this.size, timestamp: timestamp, id:this.filters.name};
					}else if (this.vid == 2) {
						var para = {token: Token, curpage:this.page, pagesize:this.size, timestamp: timestamp,pid:this.filters.name};
					} else if(this.vid == 3){
						var para = {token: Token, curpage:this.page, pagesize:this.size, timestamp: timestamp,no:this.filters.name};
					}else if(this.vid == 4){
						var para = {token: Token, curpage:this.page, pagesize:this.size, timestamp: timestamp,phone:this.filters.name};
					}else if(this.vid == 5){
						var para = {token: Token, curpage:this.page, pagesize:this.size, timestamp: timestamp,invitationCode:this.filters.name};
					}else if(this.vid == 6){
						var para = {token: Token, curpage:this.page, pagesize:this.size, timestamp: timestamp,starLevel:this.filters.name};
					}else if(this.vid == 7){
						var para = {token: Token, curpage:this.page, pagesize:this.size, timestamp: timestamp,darenNum:this.filters.name};
					}
					
					this.loading = true;
					getUserList(para).then((res) => {
						var res = res.data;
						if (res.code != 0) {
							this.$message({
								message: res.message,
								type: 'error'
							});
						} else {
							this.total = res.data.total;
							this.UserList = res.data.list;
							this.loading = false;
						}
					});
				}
			},
			getUsersList:function(){
				var Token = sessionStorage.getItem('Token');
				var timestamp=new Date().getTime();
				let para = {
					token: Token,
					curpage:this.page,
					pagesize:this.size,
					timestamp: timestamp
				};
				this.loading = true;
				getUserList(para).then((res) => {
					var res = res.data;
					if (res.code != 0) {
						this.$message({
							message: res.message,
							type: 'error'
						});
					} else {
						this.total = res.data.total;
						this.UserList = res.data.list;
						this.loading = false;
					}
				});
			},
			// 获取用户详情
			handleDetail(index, row) {
				this.FormVisible = true;
				var Token = sessionStorage.getItem('Token');
				var timestamp=new Date().getTime();
				let para = {
					token: Token,
					curpage:this.page,
					pagesize:this.size,
					timestamp: timestamp,
					id:row.id
				};
				this.loading = true;
				getUserDetail(para).then((res) => {
					var res = res.data;
					if (res.code != 0) {
						this.$message({
							message: res.message,
							type: 'error'
						});
					} else {
						this.UserDetail = res.data;
						this.loading = false;
					}
				});
			},
			handleClose(done) {
				this.$confirm('确认关闭？')
				    .then(_ => {
						done();
					})
					.catch(_ => {});
			},
			// 导出列表
			batchOperate(command) {
				switch (command) {
					case "cus_excel":
						this.cusexcel = true;
						break;
					case "rece_excel":
						this.drexcel = true;
						break;
				}
			},
			// 自定义导出
			excelSubmit(type){
				this.$refs.excelForm.validate((valid) => {
					if (valid) {
						this.$confirm('确认下载吗？', '提示', {}).then(() => {
							this.loading = true;
							var Token = sessionStorage.getItem('Token');
							var timestamp=new Date().getTime();
							if (type == '1') {
								var para = { token: Token, timestamp:timestamp,starLevel:this.excelForm.starLevel};
							} else if(type == '2'){
								var para = { token: Token, timestamp:timestamp,darenNum:this.excelForm.darenNum};
							}
							getUpload(para).then((res) => {
								var res = res.data;
								if (res.code != 0) {
									this.$message({
										message: res.message,
										type: 'error'
									});
								} else {
									this.$refs['excelForm'].resetFields();
									this.cusexcel = false;
									this.drexcel = false;
									window.location.href = res.data
									this.loading = false;
								}
							});
						});
					}
				});	
			},
			// 账号管理
			handleMent(index,row){
				this.dialogVisible = true;
				var Token = sessionStorage.getItem('Token');
				var timestamp=new Date().getTime();
				let para = {token: Token,curpage:this.page,pagesize:this.size,timestamp: timestamp,userId:row.id};
				this.loading = true;
				getAccountInfo(para).then((res) => {
					var res = res.data;
					if (res.code != 0) {
						this.$message({
							message: res.message,
							type: 'error'
						});
					} else {
						this.MentList = res.data;
						this.loading = false;
					}
				});
			},
			// 修改账号
			handleEdit(index, row) {
				this.editFormVisible = true;
				this.editForm = Object.assign({}, row);
			},
			editSubmit(){
				this.$refs.editForm.validate((valid) => {
					if (valid) {
						this.$confirm('确认提交修改的账号信息吗？', '提示', {}).then(() => {
							this.loading = true;
							var Token = sessionStorage.getItem('Token');
							var timestamp = new Date().getTime();
							var para = {token: Token,timestamp: timestamp,id:this.editForm.id,accountName: this.editForm.accountName,accountNo: this.editForm.accountNo,accountType: this.editForm.accountType,};
							console.log(para)
							editAccountInfo(para).then((res) => {
								var res = res.data;
								if (res.code != 0) {
									this.$message({
										message: res.message,
										type: 'error'
									});
								} else {
									this.$message({
										message: '修改成功',
										type: 'success'
									});
									this.loading = false;
									this.$refs['editForm'].resetFields();
									this.editFormVisible = false;
									this.dialogVisible = false;
									this.getUsersList();
								}
							});
						});
					}
				});
			},
			// 删除角色
			handleDel(index, row) {
				alert(row.id)
				this.$confirm('确认删除该记录吗?', '提示', {
					type: 'warning'
				}).then(() => {
					this.listLoading = true;
					var Token = sessionStorage.getItem('Token');
					var timestamp=new Date().getTime();
					let para = {token: Token, timestamp:timestamp,id: row.id };
					delAccountInfo(para).then((res) => {
						this.listLoading = false;
						this.$message({
							message: '删除成功',
							type: 'success'
						});
						this.getUsersList();
					});
				}).catch(() => {
				
				});
			},
			// 获取团队
			handleTeam(index,row){
				var Token = sessionStorage.getItem('Token');
				var timestamp=new Date().getTime();
				let para = {token: Token,timestamp: timestamp,userId:row.id};
				this.loading = true;
				getTeamInfo(para).then((res) => {
					var res = res.data;
					if (res.code != 0) {
						this.$message({
							message: res.message,
							type: 'error'
						});
					} else {
						this.ListForm = true
						this.List = res.data
						this.loading = false;
					}
				});
			},
			// 刷新
			Refresh(id){
				var Token = sessionStorage.getItem('Token');
				var timestamp=new Date().getTime();
				let para = {token: Token,timestamp: timestamp,userId:id};
				this.loading = true;
				ReTeamInfo(para).then((res) => {
					var res = res.data;
					if (res.code != 0) {
						this.$message({
							message: res.message,
							type: 'error'
						});
					} else {
						this.$message({
							message: '刷新成功',
							type: 'success'
						});
						this.loading = false;
					}
				});
			}
		},
		
		beforeDestroy() {
		  clearInterval(this.timer);        
		  this.timer = null;
		}
	};
</script>

<style scoped>
.el-button.is-disabled{
	color: #bfcbd9;
	    cursor: not-allowed;
	    background-image: none;
	    background-color: #eef1f6;
	    border-color: #d1dbe5;
}
.el-pagination {
    white-space: nowrap;
    padding: 2px 5px;
    color: #48576a;
}
.el-form-item {
    margin-bottom: 0px !important;
}
.el-select .el-input .el-input--suffix .el-input__inner {
    width: 130px !important;
  }  
</style>
